﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="DoubanApi.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <% var movie = ViewData["Movie"] as MovieModel; %>
    <%=movie.Title %> 影片简介
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <% var movie = ViewData["Movie"] as MovieModel; %>

    <link href="../../Content/Movie.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/swfobject.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.lightbox-0.5.min.js" type="text/javascript"></script>
    <link href="../../Content/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            $('#MovieImage a').lightBox({ fixedNavigation: true });
        });

        function InitPanel(obj) {
            var win = obj;
            if (document.getElementById) {
                if (win && !window.opera) {
                    if (win.contentDocument && win.contentDocument.body.offsetHeight)
                        win.height = win.contentDocument.body.offsetHeight;
                    else if (win.Document && win.Document.body.scrollHeight)
                        win.height = win.Document.body.scrollHeight;
                }
            }

            window.frames["QPanel"].SetFrameUrl('<%=movie.Title %>');
           
        }
    </script>

    <script type="text/javascript">
        var imageUrls='';
       <% foreach (var imagemode in movie.PreviewImages)
                       {  %>
                        imageUrls+="|"+"<%=imagemode.SamillImageUrl %>";
                    <%} %>
        if(imageUrls.length>1){
        imageUrls=imageUrls.substring(1,imageUrls.length);
        }
        function postToWb() {
            var _url = encodeURIComponent(document.location);
            var _assname = encodeURI(""); //你注册的帐号，不是昵称
            var _appkey = encodeURI("c140646a1bf8464f9da4a037ece3aab8"); //你从腾讯获得的appkey
            var _pic = encodeURI(imageUrls); //（例如：var _pic='图片url1|图片url2|图片url3....）
            var _t = ''; //标题和描述信息
            var metainfo = document.getElementsByTagName("meta");
            for (var metai = 0; metai < metainfo.length; metai++) {
                if ((new RegExp('description', 'gi')).test(metainfo[metai].getAttribute("name"))) {
                    _t = metainfo[metai].attributes["content"].value;
                }
            }
            _t = "中影国际影城新片介绍 "+document.title + "地址 " + _t ; //请在这里添加你自定义的分享内容
            if (_t.length > 120) {
                _t = _t.substr(0, 117) + '...';
            }
            _t = encodeURI(_t);

            var _u = 'http://share.v.t.qq.com/index.php?c=share&a=index&url=' + _url + '&appkey=' + _appkey + '&pic=' + _pic + '&assname=' + _assname + '&title=' + _t;
            window.open(_u, '', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="PageContent">
        <a class="MenuTitle">新片介绍</a><br />
        <br />
        <div class="Movie">
            <% var movie = ViewData["Movie"] as MovieModel; %>
            <div id="MovieInfo">
                <h1 class="MovieTitle">
                    <%=movie.Title %></h1>
                    
                <table>
                    <tr>
                        <td>
                            <img class="MovieImage" width="150" alt="" src='<%=movie.ImageLinkBig %>' />
                        </td>
                        <td width="500px">
                            <span class="MovieLabel">导演:</span> <span>
                                <%=movie.Writer.ToString() %></span>
                            <br />
                            <span class="MovieLabel">编剧:</span> <span>
                                <%=movie.Director.ToString() %></span>
                            <br />
                            <span class="MovieLabel">主演:</span> <span>
                                <%=movie.Cast.ToString() %></span>
                            <br />
                            <span class="MovieLabel">类型:</span> <span>
                                <%=movie.Movie_Type.ToString() %></span>
                            <br />
                            <span class="MovieLabel">制片地区/国家:</span> <span>
                                <%=movie.Country.ToString() %></span>
                            <br />
                            <span class="MovieLabel">语言:</span> <span>
                                <%=movie.Language.ToString() %></span>
                            <br />
                            <span class="MovieLabel">上映日期:</span> <span>
                                <%=movie.Pubdate.ToString() %></span>
                            <br />
                            <span class="MovieLabel">片长:</span> <span>
                                <%=movie.Movie_Duration.ToString() %></span>
                            <br />
                            <span class="MovieLabel">又名:</span> <span>
                                <%=movie.Aka.ToString() %></span>
                            <br />
                            <br />
                            <!--<span><a href="javascript:void(0)" onclick="postToWb();return false;" class="tmblog"><img src="http://v.t.qq.com/share/images/s/b24.png" border="0" alt="转播到腾讯微博" ></a></span>-->
                           <div id="ckepop">
	                            <span class="jiathis_txt">分享到：</span>
	                            <a class="jiathis_button_tqq"></a>
                                <a class="jiathis_button_tsina"></a>
	                            <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
                                <script type="text/javascript" src="http://v2.jiathis.com/code_mini/jia.js" charset="utf-8"></script>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div style="text-align: center">
                <div id="MoviePreview">
                </div>
            </div>
            <%if (movie.Preview!=null&& !string.IsNullOrEmpty(movie.Preview.Id))
              { %>
            <script type="text/javascript">
                $(document).ready(function () {
                    swfobject.embedSWF('<%=movie.Preview.Url %>', "MoviePreview", "450", "300", "9.0.0", null, {}, { allowFullScreen: true }, null, null);
                })
            </script>
            <%} %>
            <div id="MovieIntro">
                <a>
                    <%=movie.Title %>的剧情简介 ···</a>
                <p>
                    <%=movie.Summary %></p>
                <br />
                <a id="MovieImageTitle">
                    <%=movie.Title %>的电影图片 ···</a>
                <div id="MovieImage">
                   
                    <%if (movie.PreviewImages != null)
                      {
                          foreach (var imagemode in movie.PreviewImages)
                          {  %>
                    <li><a href="<%=imagemode.BigImageUrl %>">
                        <img style="border:0" width="93" height="100" src="<%=imagemode.SamillImageUrl %>" />
                    </a></li>
                    <%}
                      }%>
                   
                </div>
            </div>
            <%if ((bool)ViewData["IsUserLogin"])
              { %>
            <iframe id="QPanel" frameborder="0" onload="InitPanel(this);" scrolling="no" width="100%" height="0" src="/Default/WeiboQPanel.html" />
            <%} %>
        </div>
    </div>
</asp:Content>
